package com.ship.contract.service.impl;

import com.ship.common.security.utils.SecurityUtils;
import com.ship.contract.bean.ConResourceFullName;
import com.ship.contract.mapper.ConResourceFullNameServiceMapper;
import com.ship.contract.service.ConResourceFullNameService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConResourceFullNameServiceImpl extends ContractBaseServiceImpl<ConResourceFullNameServiceMapper, ConResourceFullName> implements ConResourceFullNameService {

    /**
     * 根据用户名查询资源方相关信息
     * @param username
     * @return
     */
    @Override
    public List<ConResourceFullName> getConIdByUser(String username,String resourceFullName) {
        if (resourceFullName == null){
            return this.baseMapper.getConIdByUserAll(username);
        }
        return this.baseMapper.getConIdByUser(username , resourceFullName);
    }

    /**
     * 资源方信息入库
     * @param conResourceFullName
     */
    @Override
    public void setResourceFullName(ConResourceFullName conResourceFullName) {
        super.save(conResourceFullName);
    }

}
